<template>
    <div class="process-monitoring-box">
        <commpVxeTable
         :key="dataTableKey"
         :config="dataTableConfig" 
         :columns="columnsVxe" 
         :formItem="formItem"
         ref="acceptanceRegistrationRef"
         @checkboxChange="selectedRowKeysChange"
         @searchEvent="searchEvent"
         >
            <!-- <template v-slot:externalOperations="{data}">
                <vxe-form-item>
                    <template>
                        <a-button class="blue-btn" type="primary" @click="exportClick()">导出</a-button>
                    </template>
                </vxe-form-item>
                <vxe-form-item>
                    <template>
                        <a-button class="blue-btn" type="primary" @click="setStatusClick()">批量设置状态</a-button>
                    </template>
                </vxe-form-item>
                <vxe-form-item>
                    <template>
                        <a-button class="blue-btn" type="primary" @click="setPositionClick()">批量设置所属库</a-button>
                    </template>
                </vxe-form-item>
            </template> -->
            <template v-slot:fcontent_name="{row}">
                <a @click="viewClick(row)">{{ row.fcontent }}</a>
            </template>
            <!-- <template v-slot:operation_btn="{row}" data-desc="自定操作栏">
                <a-form layout="inline" class="search-form" >
                    <a-form-item >
                        <a-button class="red-btn" type="primary" @click="viewClick(row)">查看</a-button>
                    </a-form-item>
                </a-form>
            </template> -->
        </commpVxeTable>
        <a-modal
            title="查看"
            :visible="visible"
            @ok="visible = false"
            @cancel="visible = false"
            :width="1000"
        >
            <a-form layout="inline" class="info-manage-status-form" :key="infoManageKey">
                <a-form-item label="操作类型">
                    {{ batchData.ftype1 }}
                </a-form-item>
                <a-form-item label="操作科室" >
                    {{ batchData.fczbm }}
                </a-form-item>
                <a-form-item label="操作人">
                    {{ batchData.fczr }}
                </a-form-item>
                <a-form-item label="日志分类">
                    {{ batchData.ftype2 }}
                </a-form-item>
                <a-form-item label="ip" >
                    {{ batchData.fpid }}
                </a-form-item>
                <a-form-item label="操作日期">
                    {{ batchData.createTime }}
                </a-form-item>
                <br/>
                <a-form-item label="操作内容" class="info-manage-flex-1">
                    <a-textarea
                        :readOnly="true"
                        v-model:value="batchData.fcontent"
                        :autosize="{ minRows: 3, maxRows: 10000 }"
                    />
                </a-form-item>
                
            </a-form>
            <template slot="footer">
                <div>
                    <a-button @click="visible = false" >关闭</a-button>
                </div>
            </template>
        </a-modal>
    </div>
</template>
<script>
import assessCheckApi from './service/api'
import commpVxeTable from '@/components/commp-vxe-table/commp-vxe-table.vue'
import blobType from '@/common/blobType'
import moment from 'moment'
import compSelector from '@/components/compSelector/compSelector.vue'
import {
    queryJobByJobIdServe,
    getSqsxBm,
    spcyJcydjbfqJcydjb,
    spcyJcydjbreplateFile,
    jcyglexportJcyLbData,
    jcyglbatchSzSsk,
    jcyglbatchSzJcyState,
    jcyglupdateUserInfo,
} from './service/index'
export default {
    components:{
        commpVxeTable,
        compSelector,
    },
    props:{

    },
    data(){
        return{
            infoManageKey:null,
            visible:false,
            batchData:{},
            addEditParameter:{},
            dataTableKey:null,
            formItem:[{
                label: '操作类型',//(检查员登记类别)字典
                model: 'ftype1',
            },{
                label: '操作科室',//(检查员登记类别)字典
                model: 'fczbm',
                type:'Select',
                dictionaryType:'操作日志科室'
            },{
                label: '操作人',//(检查员登记类别)字典
                model: 'fczr',
            },{
                label: '操作内容',//(检查员登记类别)字典
                model: 'fcontent',
            },{
                label: '日志分类',//(检查员登记类别)字典
                model: 'ftype2',
                type:'Select',
                dictionaryType:'操作日志日志分类'
            },{
                label: '开始时间',//(检查员登记类别)字典
                model: 'startTime',
                type:'datePicker',
                format:'YYYY-MM-DD'
            },{
                label: '结束时间',//(检查员登记类别)字典
                model: 'endTime',
                type:'datePicker',
                format:'YYYY-MM-DD'
            }],//
            columnsVxe:[{
                title: '操作类型', //列头显示文字
                field: 'ftype1',
                width:140,
            },{
                title: '操作科室', //列头显示文字
                field: 'fczbm',
                width:150,
            },{
                title: '操作人',
                field: 'fczr',
                width:90,
            },{
                title: '操作内容',
                field: 'fcontent',
                slots: { default: 'fcontent_name' },
            },{
                title: '日志分类',
                field: 'ftype2',
                width:125,
            },{
                title: 'ip',
                field: 'fpid',
                width:260,
            }
            ,{
                title: '操作日期',
                field: 'createTime',
                width:165,
            }
            ],
            dataTableConfig:{
                api: assessCheckApi.list,
                rowId: 'id',
                fywflcode:blobType.fywflcodeArr[blobType.menuType.indexOf(this.$route.name.substring(this.$route.name.indexOf('__'),this.$route.name.indexOf('_a')+2))],
                paramet:{
                }
            },
            selectedRowKeysArr:[],
            searchFrom:{},
        }
    },
    watch:{

    },
    mounted(){
        
    },
    methods:{
        searchEvent(searchFrom){//搜索
            this.searchFrom = {...this.dataTableConfig.paramet,...searchFrom}
        },
        selectedRowKeysChange(row){//获取选中表格rowKey
            this.selectedRowKeysArr = []
            row.forEach(item => {
                this.selectedRowKeysArr.push(item.id)
            });
        },
        viewClick(row){
            this.batchData = row
            this.infoManageKey = Date.now()
            this.visible = true
        },
    }
}
</script>
<style lang="less">
    .info-manage-status-form{
        .ant-form-item-label{
            width: 70px;
        }
        .info-manage-flex-1{
            display: flex;
            .ant-form-item-control-wrapper{
                flex: 1;
            }
        }
    }
</style>